﻿
using System;
using System.Linq;
using System.Collections.Generic;
using Gola.VN.Scb.Web.Common.Entities;

namespace Gola.VN.Scb.Web.Common.Models
{
    [Serializable]
    public class UICategoryModels
    {
        public int Id { set; get; }

        public string Name { set; get; }

        public string InnerLink
        {
            get
            {
                return (Subcategories == null || Subcategories.Count() <= 0)
                         ? string.Format("/san-pham/{0}/{1}", Id, Name.ConvertToUnSign())
                         : string.Format("/danh-muc/{0}/{1}", Id, Name.ConvertToUnSign());
            }
        }

        public List<ProductEntity> TopProducts { set; get; }
        public IEnumerable<UICategoryModels> Subcategories { set; get; }
        public bool HasProduct { get { return (TopProducts != null && TopProducts.Count > 0); }
        }
    }

    [Serializable]
    public class UICategoriesModels
    {
        public string CategoryTitle { set; get; }
        public IEnumerable<UICategoryModels> Categories { set; get; }
        public IEnumerable<UICategoryModels> Subcategories { set; get; }
        public IEnumerable<UICategoryModels> Navigartion { set; get; }
        public IEnumerable<ProviderEntity> ProviderLocations { set; get; }
    }


}